package com.hwc.demo.springcloud.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hwc.demo.springcloud.entity.Dept;
import com.hwc.demo.springcloud.service.feign.DeptClientService;

@RestController
public class DeptController_consumer_feign {
	@Autowired
	DeptClientService deptClientService;
	
	@PostMapping("/consumer/dept")
	public int add(Dept reqDo) {
		
		return deptClientService.add(reqDo);
	}

	@GetMapping("/consumer/dept/{id}")
	public Dept get(@PathVariable Long id) {
		
		return deptClientService.get(id);
	}

	@GetMapping("/consumer/dept")
	public List<Dept> list() {
		
		return deptClientService.list();
	}
}
